<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>雕塑手办-英雄联盟周边商城</title>
    <link rel="stylesheet" href="{{ static("css/swb.css") }}"/>
    <link rel="stylesheet" href="{{ static("css/public.css") }}"/>
    <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css"/>
    <link rel="stylesheet" href="{{ static("css/shopPage.css") }}"/>
    <link rel="stylesheet" href="{{ static("css/jquery.pagination.css") }}"/>
</head>

<body>
<header sty="hi75">
    <div class="banner cf">
        <div sty="mt17" class="logo-box ftl">
            <a sty="wi297 hi39" class="logo dpib" href=""></a>
        </div>
        <div sty="hi30 mt22" class="header-right-box ftr fdl">
            {% if user.is_authenticated %}
                <div sty="mt8 mr10" class="login_btn fl">
                    欢迎您：<a href="">{{ user.username }}</a>
                    <span>|</span>
                    <a href="{{ url('users:logout') }}">退出</a>
                </div>
            {% else %}
                <div sty="pr20 cf">
                    <a sty="pr6 lh30" href="{{ url('users:login') }}">您好，请登录 </a>
                </div>
            {% endif %}
            <div sty="pr28 cf">
                <a href="{{ url('users:Shopping') }}">
                    <i sty="wi28 hi25 mt3 mr4" class="shop ftl"></i>
                    <span sty="lh30 pr6" class="ftl">购物车</span>
                    <span sty="wi20 hi20 lh20 mt7 " class="shop-num ftl tac">0</span>
                </a>
            </div>
            <div sty="pr28 cf">
                <i sty="wi24 hi26 mt3 mr4" class="service ftl"></i>
                <span sty="lh30" class="ftl">客服咨询</span>
            </div>
            <div sty="cf">
                <i sty="wi20 hi20 mt5 mr4" class="qr-code ftl"></i>
                <span sty="lh30" class="ftl">微信商城</span>
            </div>
        </div>
    </div>
</header>
<div class="main  bg-index">
    <div class="banner">
        <nav class="cf">
            <ul class="ftl">
                <li><a class="" href="{{ url("index:index") }}">商城首页</a></li>
                {% for category_id, category_info in category_dict.items() %}
                    {% for category_1 in category_info["channels"] %}
                        <input type="hidden" value={{ (category_page_id) }} />
                        <input type="hidden" value={{ category_id }} />
                        {% if category_id == category_page_id %}
                                <input type="hidden" value={{ category_page_id }}/>
                            <li><a class="active"  href="{{ url("goods:list",kwargs={'category_id':category_1["id"], "page_num":1}) }}">{{ category_1["name"] }}</a></li>
                        {% else %}
                           <li>
                            <a href="{{ url("goods:list",kwargs={'category_id':category_1["id"], "page_num":1}) }}">{{ category_1["name"] }}</a>
                            </li>
                        {% endif %}
                    {% endfor %}
                {% endfor %}
            </ul>
            <div sty="mt15 mr34" class="ftr pr cf">
                <input sty="wi239 hi30 fs14" class="ftl" type="text" onfocus="$('nav .default').hide()"
                       onblur="if (this.value == '') { $('nav .default').show() } else { $('nav .default').hide() }"/>
                <a sty="tp9 lt10 fs14" class="default pa" href="">阿狸</a>
                <div sty="wi45 hi30" class="search-btn ftl">
                    <a href="">
                        <i sty="wi21 hi21 mt5 ml12" class="dpib"></i>
                    </a>
                </div>
            </div>
        </nav>
        <div class="streamer">
            {% for category_1 in categories["channels"] %}

                <img src="{{ category_1["image"] }}" alt=""/>
            {% else %}
                <img src="#" alt=""/>
            {% endfor %}
        </div>
        <div sty="pl20 fs16 lh40" class="crumbs">
            <a href="{{ url("index:index") }}">首页商城</a>
            <span sty="ml10 mr10">\</span>
            {% for category_1 in categories["channels"] %}
                <a href="{{ url("goods:list",kwargs={'category_id':category_1["id"], "page_num":1}) }}">{{ category_1["name"] }}</a>
            {% endfor %}
        </div>
        <div>
            <!-- Swiper -->
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide menu">
                        <ul>
                            <li>
                                <dl>
                                    {#                                    {% for _, category_info in categories.items() %}#}
                                    {% for category_1 in categories["channels"] %}
                                        <a href="#">
                                            <input type="hidden" id="category_id" value="{{ category_1["id"] }}">
                                            <dt>{{ category_1["name"] }}</dt>
                                        </a>
                                    {% endfor %}

                                    {% for category_2 in categories["sub_cat"] %}

                                        <a href="{{ url("goods:list",kwargs={'category_id':category_2["id"], "page_num":1}) }}">
                                            <dd>{{ category_2["name"] }}</dd>
                                        </a>
                                    {% endfor %}
                                    {#                                    {% endfor %}#}
                                </dl>
                            </li>
                            <li>
                                <dl>
                                    拍
                                    <dt>价格</dt>
                                    <dd>100-300元</dd>
                                    <dd>300元以上</dd>
                                </dl>
                            </li>
                        </ul>


                    </div>
                    <div class="swiper-slide content">
                        <div class="menu-button">
                            <div class="bar"></div>
                            <div class="bar"></div>
                            <div class="bar"></div>
                        </div>
                        <div class="shop-content">
                            <div sty="hi65 pr250" class="operation fdr">
                                {#                                <div>排序方式</div>#}
                                {#                                <div sty="mr20" class="available fdl">#}
                                {#                                    <div><i sty="wi16 hi16 mt25 mr8" class="dpib"></i></div>#}
                                {#                                    <div><span>仅显示有货</span></div>#}
                                {#                                </div>#}
                                <!-- <div>分页</div> -->
                            </div>
                            <div class="shopList-box">
                                <ul sty="" class="cf">
                                    {% for goods in page_skus %}
                                        <li>

                                            <div class="shopList-li-div">
                                                <div>
                                                    <a href="{{ url('goods:shop_details',kwargs={"good_id":goods.id}) }}">
                                                        <img src="{{ goods.front_image }}" title="{{ goods.name }}">
                                                    </a>
                                                </div>
                                                <p class="ccsl"
                                                   title="{{ goods.name }}">{{ goods.name }}</p>
                                                <p>售价：<span>￥ {{ goods.current_price }}</span></p>
                                            </div>

                                        </li>
                                    {% endfor %}
                                </ul>
                                <div class="pagination">
                                    <div id="pagination" class="page"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="r_wrap fr clearfix">

</div>
<footer>
    <div sty="pt20 pb20" class="guarantee banner">
        <ul class="flex">
            <li>
                <i class="sales-return"></i>
                <span>7天无理由退换货</span>
            </li>
            <li>
                <i class="quality-goods"></i>
                <span>100%官方正品</span>
            </li>
            <li>
                <i class="pinkage"></i>
                <span>全场每单满199元包邮</span>
            </li>
        </ul>
    </div>
    <div class="issue">
        <div class="banner">
            <ul class="flex tac">
                <li>
                    <dl>
                        <dt>购物指南</dt>
                        <dd>帐号注册与登录</dd>
                        <dd>购买流程介绍</dd>
                        <dd>支付方式</dd>
                        <dd>常见问题</dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>配送服务</dt>
                        <dd>全场满199元免运费</dd>
                        <dd>配送范围及运费</dd>
                        <dd>配送进度查询</dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>售后服务</dt>
                        <dd>7天无理由退换货</dd>
                        <dd>退换货流程</dd>
                        <dd>商品送错的处理方案</dd>
                        <dd>售后服务及投诉</dd>
                    </dl>
                </li>
                <li>
                    <dl>
                        <dt>服务中心</dt>
                        <dd>售前咨询 售后咨询</dd>
                        <dd>客服热线：0755-25727866</dd>
                        <dd>售后：service@lolriotmall.qq.com</dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div sty="mt25 lh40" class="copy tac">技术支持：全栈12 师文博</div>
</footer>
</body>
<script src="{{ static("js/jquery.js") }}"></script>
<script src="{{ static("js/swb.js") }}"></script>
<script src="{{ static("js/public.js") }}"></script>

<script type="text/javascript" src="{{ static('js/jquery.pagination.min.js') }}"></script>
<script>
    $(function () {
        console.log(category_page_id.defaultValue)
        $('#pagination').pagination({
            currentPage: {{ page_num }},
            totalPage: {{ total_page }},
            callback: function (current) {
                {#location.href = '/list/115/1/?sort=default';#}
                location.href = '/list/{{ category_page_id }}/' + current;
            }
        })
    });
</script>

<!-- Swiper JS -->
<script src="https://unpkg.com/swiper/js/swiper.min.js"></script>
<!-- Initialize Swiper -->
<script>
    var menuButton = document.querySelector('.menu-button');
    var openMenu = function () {
        swiper.slidePrev();
    };
    var swiper = new Swiper('.swiper-container', {
        grabCursor: true,
        slidesPerView: 'auto',
        initialSlide: 1,
        resistanceRatio: 0,
        slideToClickedSlide: true,
        on: {
            slideChangeTransitionStart: function () {
                var slider = this;
                if (slider.activeIndex === 0) {
                    menuButton.classList.add('cross');
                    // required because of slideToClickedSlide
                    menuButton.removeEventListener('click', openMenu, true);
                } else {
                    menuButton.classList.remove('cross');
                }
            }
            , slideChangeTransitionEnd: function () {
                var slider = this;
                if (slider.activeIndex === 1) {
                    menuButton.addEventListener('click', openMenu, true);
                }
            },
        }
    });
</script>

</html>